package com.work.music.common;

import com.work.music.utils.StringUtil;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("serial")
public class ResponseJson implements Serializable {
    private int status = 0;
    private String msg = "操作成功";
    private int num = 0;
    private Object obj = "";
    private List<?> list = new ArrayList<Object>();

    public int getStatus() {
        return status;
    }

    public void setStatus(int errno) {
        this.status = errno;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    @SuppressWarnings("rawtypes")
    public List getList() {
        return list;
    }

    public void setList(List<?> list) {
        this.list = list;
    }

    public ResponseJson(Object obj, List<?> list) {
        if (obj != null) {
            this.obj = obj;
        }
        if (list != null) {
            this.list = list;
        }
    }

    public ResponseJson(int status, String msg, Object obj, List<?> list) {
        if (obj != null) {
            this.obj = obj;
        }
        if (list != null) {
            this.list = list;
        }
        this.status = status;
        if (!StringUtil.isNull(msg)) {
            this.msg = msg;
        }
    }

    public ResponseJson() {
    }
}
